local Rehearsal = fk.CreateSkill {
  name = "#Rehearsal",
}

Fk:loadTranslationTable {
  ["#Rehearsal"] = "预演",
  [":Rehearsal"] = "记录所有角色的体力值。", -- 已有范围：游戏开始时、每轮开始时、每回合开始时。忽略死人
}

local Rehearsal_spec = {
  global = true,
  can_refresh = Util.TrueFunc,
  on_refresh = function(self, event, target, player, data)
    local scope = "game"
    if event == fk.RoundStart then
      scope = "round"
    elseif event == fk.TurnStart then
      scope = "turn"
    end
    local room = player.room
    local hp = {}
    for _, p in ipairs(room.alive_players) do
      table.insert(hp, { p.id, p.hp })
    end
    local list = room:getBanner("Rehearsal_HP") or {}
    list[scope] = hp
    room:setBanner("Rehearsal_HP", list)
  end,
}

Rehearsal:addEffect(fk.GameStart, Rehearsal_spec)
Rehearsal:addEffect(fk.RoundStart, Rehearsal_spec)
Rehearsal:addEffect(fk.TurnStart, Rehearsal_spec)

return Rehearsal